package com.msmall.community.team.dao;

import java.util.List;

import com.msmall.base.dao.BaseDao;
import com.msmall.community.team.model.TeamUser;

public interface TeamUserDao extends BaseDao<TeamUser, Long>{

	public TeamUser load(Long userid, Long teamid) throws Exception;
	
	public List<TeamUser> loadByUser(Long userid) throws Exception;
	
	public List<TeamUser> loadByTeam(Long teamid) throws Exception;
	
	/**
	 * 获得组的创建者 
	 */
	public TeamUser getTeamCreator(Long teamid) throws Exception;
	/**
	 * 获得组的管理者  creator: true 包括创建者 false:不包括创建者
	 */
	public List<TeamUser> getTeamManagers(Long teamid, boolean creator) throws Exception;
	
	/**
	 * 获得组的普通成员，不包括创建者和管理者 
	 */
	public List<TeamUser> getTeamMembers(Long teamid) throws Exception;
	
	/**
	 * 根据组员状态获得组用户信息
	 * type TeamUser.STATUS_xx,如果为-1则获得所有用户
	 * @author zhzy
	 */
	public List<TeamUser> getMembers(Long teamid, int type) throws Exception;
}
